package routes

import (
	"digital/server/controller"
	"digital/server/middleware"
	"github.com/gin-gonic/gin"
)

// 路由信息
func CollectRouter(r *gin.Engine) *gin.Engine {
	r.Use(middleware.CORSMiddleware())
	r.GET("/api/club", controller.GetClubs)                 //进入社团模块时，获取社团信息
	r.POST("/api/club/CollectClub", controller.CollectClub) //收藏或取消社团
	r.GET("/api/activity", controller.GetActivities)        //进入活动模块时，获取活动信息
	r.POST("/api/joinActivity", controller.JoinActivity)
	r.POST("/api/activity/CollectActivity", controller.CollectActivity) //收藏或取消收藏活动
	r.POST("/api/club/JoinClub", controller.JoinClub)
	r.GET("api/club/ClubDetail", controller.GetClubDetail)
	r.POST("/login", controller.Login)
	//r.GET("/api/msg", controller.GetAllMesg)
	r.GET("/api/detail", controller.GetDetail)
	r.GET("/api/getActivityApplies", controller.GetActivityApplies)
	r.POST("/api/saveProfile", controller.SaveUserProfile)
	r.DELETE("api/deletehonor", controller.DeleteHonor)
	r.POST("api/savehonor", controller.SaveHonor)
	r.GET("/api/getApplies", controller.GetApplies)
	r.GET("/api/getCollectedActivities", controller.GetCollectedActivities)
	r.GET("/api/getCollectedClubs", controller.GetCollectedClubs)
	r.GET("/api/getJoinedClubs", controller.GetJoinedClubs)
	r.POST("/api/club/submitForm", controller.JoinClub)
	r.POST("/uploadFile", controller.MyUploadHandler)
	r.POST("api/club/createClub", controller.CreateClub)
	r.GET("/home", controller.GetAll)
	//r.GET("/api/info", middleware.AuthMiddleware(), controller.Info)
	//r.POST("/api/register", controller.Register)
	//r.POST("/api/login", controller.Login)
	return r
}
